home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0151.ZIP
/
ZAPLOAD.DOC
< prev
Wrap
Text File
|
1983-09-08
|
9KB
|
260 lines
.he ZAPLOAD- Binary to Intel Hex (c) T. Jennings 1980, 1981, 1982 Page #
ZAPLOAD- MSDOS version
ZAPLOAD can be used to convert any file (binary is ì
assumed) to INTEL hex format, and send to one or more ì
destinations: a disk file, the punch device, or the printer. ì
There are many options to select various things; ones or twos ì
complement checksums, where to send the hex, specifying the load ì
and start addresses, etc. All of the available options are listed ì
below, followed by a more detailed description of each.
The very last section deals with connecting a Sunrise ì
Electronics ZAP-80 EPROM burner to a computer via ZAPLOAD, since ì
that was it's original intent.
ZAPLOAD gives a quick list and description of it's ì
commands when operated improperly. To get this list, type ZAPLOAD ì
without any command line options. You will also get the list ì
whenever you make any command errors.
.pa
Zapload is executed from an MSDOS system, and converts ì
MSDOS files from the disk, to INTEL hex format. All options are ì
specified on the command line when ZAPLOAD is run. ZAPLOAD has ì
the following syntax:
ZAPLOAD <file to convert> <any legal options ...>
After ZAPLOAD has sent the entire file, it will display ì
on the console a 16 bit two's complement checksum of every data ì
byte sent. This checksum is of the data bytes only. This can be ì
used in conjunction with the destination device to provide ì
another check of data integrity.
An INTEL hex file consists of one or more data records, ì
followed by an end of file record. These records have the ì
following format:
DATA RECORDS: : bb llll tt dd dd dd .... cc
: says this is the start of a record,
bb is the number of data bytes to follow,
llll is the address to load the data byte at,
tt is the record type, 00 for data,
dd dd ... are the data bytes,
cc is the checksum of bb llll tt and all dd data
bytes.
END OF FILE RECORDS: : bb ssss tt cc
: is the same as a data record,
bb is zero, (no data),
ssss is the program start address,
tt is 01 to indicate end of file,
cc is the checksum of bb ssss and tt.
There are no data bytes.
After the cc bytes have been sent, a CR LF sequence is ì
sent for readability. Programs that read INTEL hex ignore any ì
characters before the :, and after the cc checksum. Or at least ì
are supposed to.
If you specify no options at all, ZAPLOAD processes the ì
file but does not send the output anywhere. The following are the ì
defaults for Intel Hex generation:
- 32 byte data records (20 hex),
- 2's complement checksums,
- Initial load address of 0,
- Start address of 0.
.pa
ZAPLOAD OPTIONS
There are many options; these fall roughly into two ì
categories; those that control the record format, for non-ì
standard devices (damn them) and those that control where to send ì
it as it is generated.
Options are specified on the command line, following the ì
filename. Each option is a single letter, and may appear in any ì
order. Some options take an additional argument; like setting the ì
load address. In these cases the argument follows the option ì
letter, seperated by one or more spaces, like so:
ZAPLOAD file l 8000
Option letters may be optionally preceded by a -, for ì
UNIX freaks, like so:
ZAPLOAD file -l 8000
RECORD FORMAT OPTIONS
b <hex number>
Set the number of bytes sent per record from the default ì
20 hex to <hex number>. <hex number> must be less than 1024. ì
Please do not use 0. (BUG: ZAPLOAD will not catch a byte count of ì
zero. It might try to produce 65535 byte records, and bomb ì
everything.)
z
Generate ones complement checksums instead of two's. ì
Obscure option for use with non-standard devices.
l <hex number>
Set the load address to <hex number>. The default is 0 ì
hex if this option is not used. The load address for each record ì
sent will increment by the byte count.
r <hex number>
Change the default run address of 0 to <hex number>. This ì
is used only in the end of file record, to indicate the starting ì
address of the file just sent. Things like EPROM burners do not ì
use this; some computers with download facilities might.
.pa
FILE DESTINATION CONTROLS
The following options control where the file is sent, and ì
how it is sent. If none of these are specified, it is merely sent ì
to the console. Each record is always typed on the console, ì
character by character, as it is sent, unless the 'X' option is ì
given. Running ZAPLOAD with only the 'X' option would cause the ì
file to be sent nowhere at all. (Why?) A control-Z terminating ì
character is sent to the destination device after the file is ì
transferred.
a
Send to the aux device. This could also be done via the ì
'f' option: f AUX. See below.
f <file name>
Create a file <file name>, and send each byte there. This ì
can be used to generate INTEL hex disk to disk, without using any ì
external devices.
w <decimal number>
Software delay by <decimal number> after each character ì
is sent. This can be used for those poorly designed devices that ì
require but do not use character by character handshake. The ì
default here is 0, obviously, and 10 is about 50 milliseconds for ì
a 4MHz Z80. This was necessary for the ZAP-80, as is has a ì
software UART, and takes too long to process a byte to keep up.
Pretty useless with disk files.
e <decimal number>
Software delay after the CR LF sequence at the end of a ì
record. Some loaders require more time at the end of the record, ì
in order to generate and check the checksum. The delay w <decimal ì
number> is still done after sending the last cc byte, but not on ì
the CR LF sequence.
.pa
General Controls
s <dddd>
Skip <dddd> decimal bytes at the beginning of the file ì
before processing. This is useful when generating HEX files from ì
CP/M .CMD files or the like that have a header at the beginning.
o
e
Process only even or odd numbered bytes. This is very ì
useful when generating EPROM code for 16 bit processors like the ì
8086, that have even bytes in one PROM, and the odd ones in ì
another. By using the form:
zapload file.cmd s 128 e f low.hex
and
zapload file.cmd s 128 o f hi.hex
You can make the two EPROM files necessary for an 8086 ì
bootstrap ROM, or whatever.
x
List output on the console. All hex records generated are ì
typed.
.pa
TYPICAL USAGE
Here are some examples for loading INTEL hex to some ì
common devices:
zapload test.com x
This loads test.com to the console, and sends 32 byte ì
records, load address of 0, start address of zero.
zapload test.com e 10 w 10
This loads a ZAP80 tied to the punch port, with the ì
necessary software delays to accomodate the ZAP80.
zapload test.com f test.hex
Convert file test.com to hex, and make a hex file ì
test.hex. This "undoes" Digital Research's LOAD utility.
zapload test.com l 100 r 100 p f test.hex x
Convert test.com to Intel hex, send it to the CP/M PUN: ì
device, to the disk file TEST.HEX, and listing it on ì
the console. The load address starts at 100h, and the run address ì
is 100h.
.pa
Connecting the ZAP-80 to FIDO or any other computer
You will not find this data in any Sunrise Electronics ì
documentation. The ZAP80 is filled with bugs, and the manual is ì
terrible.
- The ZAP80 requires 300 baud, 1 1/2 stop bits. Idiots. ì
Use two stop bits.
- The ZAP 80 cannot be run faster than 300 baud, and can ì
not handle even this without software delays.
- Though they claim that it uses the RTS line or ì
whatever, it really does not.
- Even though each record may be loading properly, the ì
display will always say there is a load error after the first ì
record. Ignore it, and once the entire file is sent, do the ì
following:
Reset the ZAP80, and checksum the entire data ares just ì
sent. (CKSM key, then the lower and upper addresses). Compare ì
this to the data checksum typed by ZAPLOAD. If the last four ì
digits are the same, all is well. (It usually is)
HARDWARE CONNECTIONS
-Use a typical 3 wire connection, swapping pins 2 and 3 ì
until it works. (Necessary on FIDO, and done in it's cable).
-On the ZAP80, tie pins 4 and 5 together. (Fool RTS)
Don't forget to set FIDO's punch port, TUART port B, to ì
300 baud 2 stop bits.
END OF MANUAL